package scauCmiScaffolding.compiled;

import org.eclipse.jet.JET2Context;
import org.eclipse.jet.JET2Template;
import org.eclipse.jet.JET2Writer;

public class _jet_checkPropertyEqual_0 implements JET2Template {

    public _jet_checkPropertyEqual_0() {
        super();
    }

    private static final String NL = System.getProperty("line.separator"); //$NON-NLS-1$

    public void generate(final JET2Context context, final JET2Writer __out) {
        JET2Writer out = __out;
        out.write("public static <T> boolean CheckPropertyEqual(T originProperty,T comparedProperty){");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    //基本类型经过参数传递后会自动装箱");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    String[] className = originProperty.getClass().getName().split(\"\\\\.\");");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    if(className[0].equals(\"java\")&&className[1].equals(\"math\")){");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    \treturn((Comparable)originProperty).compareTo(comparedProperty) == 0 ? true : false;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    }else{");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        return originProperty.equals(comparedProperty);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    }");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("}");  //$NON-NLS-1$        
    }
}
